import { config, request } from 'utils'

const { api } = config
const {
  pubdictValueListUrl,
  arcgisFeatureServerQuery
} = api

// POST，鸟类名称查询
export async function birdNamesQuery(params) {
  return request(pubdictValueListUrl, {
    method: 'POST',
    data: {
      "dictKey":"bird_type"
    },
  });
}


export async function queryBirdThematic(param){
  const { type, ...params } = param;
  const queryStr = Object.keys(params)
    .map(key => params[key] && `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
    .join('&');
  return request(`${type}/query?f=json&`+queryStr, {
    method: 'GET',
    data: params,
  });
}
